import _ from 'lodash';
import { ObjectDirective } from 'vue';

export const permission: ObjectDirective = {
    mounted(el: HTMLButtonElement, binding) {
        if (binding.value == undefined) return;

        const action = binding.value;
        // 如果action不传，则认为不需要授权认证
        if (action == undefined) {
            return;
        }
        // console.log(vnode.ref.i.ctx.hasPermission(action), '虚拟')
        // 校验为没有权限就remove该元素
        // if (!checkUserAuth(action)) {
        //     el.remove();
        // }
    },
};
